package gui;

import java.text.NumberFormat;

import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import java.awt.Font;

/**
 * 	public static final int TITLE_SCREEN_PANEL = 0;
	public static final int PARTY_CREATION_PANEL = 1;
	public static final int TRAVEL_OPTIONS_PANEL = 2;
	public static final int M5_END_SCREEN = 3;
	
	//public static final int STORE_PANEL = 4;
	public static final int LANDMARK_PANEL = 5;
	public static final int STORE_PANEL = 6;
	public static final int M6_END_SCREEN = 7;
	public static final int TRAIL_PANEL = 8;
	public static final int WIN_PANEL = 9;
	public static final int RIVER_PANEL = 10;
	
 * 
 * @author Jarv
 *
 */

public class RiverPanel extends JPanel {
	private JLabel lblRiverTitle;
	private JButton btnFord;
	private JButton btnCaulk;
	private JButton btnFerry;
	private JLabel lblFerryDescription;
	private JLabel lblCaulkDescription;
	private JLabel lblFordDescription;
	private double cost;
	private int waitTime;
	private JLabel lblRiverDepth;
	private JLabel lblRiverWidth;
	private JPanel panelImage;
	/**
	 * Create the panel.
	 */
	public RiverPanel(double cost, int waitTime) {
		setLayout(null);
		
		this.cost = cost;
		this.waitTime = waitTime;
		
		lblRiverTitle = new JLabel("<River Name>");
		lblRiverTitle.setFont(new Font("Tahoma", Font.PLAIN, 22));
		lblRiverTitle.setHorizontalAlignment(SwingConstants.CENTER);
		lblRiverTitle.setBounds(91, 11, 506, 45);
		add(lblRiverTitle);
		
		btnFord = new JButton("Ford River");

		btnFord.setBounds(91, 314, 124, 23);
		add(btnFord);
		
		btnCaulk = new JButton("Caulk Wagon");
		btnCaulk.setBounds(91, 348, 124, 23);
		add(btnCaulk);
		
		btnFerry = new JButton("Take Ferry");
		btnFerry.setBounds(91, 382, 124, 23);
		add(btnFerry);
		
		lblFerryDescription = new JLabel();
		ferryText(cost, waitTime);
		lblFerryDescription.setBounds(225, 386, 366, 14);
		add(lblFerryDescription);
		
		lblCaulkDescription = new JLabel("Caulk the wagon and attempt to float across");
		lblCaulkDescription.setBounds(225, 352, 281, 14);
		add(lblCaulkDescription);
		
		lblFordDescription = new JLabel("Attempt to ford the river");
		lblFordDescription.setBounds(225, 318, 281, 14);
		add(lblFordDescription);
		
		lblRiverDepth = new JLabel("River Depth: <depth>");
		lblRiverDepth.setBounds(91, 256, 281, 14);
		add(lblRiverDepth);
		
		lblRiverWidth = new JLabel("River Width: <Width>");
		lblRiverWidth.setBounds(91, 279, 281, 14);
		add(lblRiverWidth);
		
		panelImage = new JPanel();
		panelImage.setBounds(32, 60, 658, 185);
		add(panelImage);

	}

	public RiverPanel() {
		this(50.00, 2);
	}
	
	public double getCost() {
		return cost;
	}

	public void setCost(double cost) {
		this.cost = cost;
	}

	public int getWaitTime() {
		return waitTime;
	}

	public void setWaitTime(int waitTime) {
		this.waitTime = waitTime;
	}

	public void setBtnFord(JButton btnFord) {
		this.btnFord = btnFord;
	}

	public void setBtnCaulk(JButton btnCaulk) {
		this.btnCaulk = btnCaulk;
	}

	public void setBtnFerry(JButton btnFerry) {
		this.btnFerry = btnFerry;
	}

	
	/**
	 * updates the essential panel labels
	 * @param riverTitle, this sets the Title of the panel (the river's name)
	 * @param ferryDescription this sets the ferry Description (which varies
	 * from river to river depending on the ferry price)
	 */
	public void setupRiverPanelMin(String riverTitle, String ferryDescription){
		lblRiverTitle.setText(riverTitle);
		lblFerryDescription.setText(ferryDescription);
	}
	
	public void ferryText(double cost, int waitTime) {
		lblFerryDescription.setText("Saftey is guaranteed but you have to pay " + costToString() 
				+ " and wait " + waitTime + " days");
	}
	
	public String costToString() {
		NumberFormat nf = NumberFormat.getCurrencyInstance();
		return nf.format(cost);
	}


	//////////////////////////////////////////////////////////////////////////////
	//
	//
	//	GETTERS AND SETTERS
	//
	//
	//////////////////////////////////////////////////////////////////////////////
	
	/**
	 * @return the lblRiverDepth
	 */
	public JLabel getLblRiverDepth() {
		return lblRiverDepth;
	}

	/**
	 * @param lblRiverDepth the lblRiverDepth to set
	 */
	public void setLblRiverDepth(JLabel lblRiverDepth) {
		this.lblRiverDepth = lblRiverDepth;
	}

	/**
	 * @return the lblRiverWidth
	 */
	public JLabel getLblRiverWidth() {
		return lblRiverWidth;
	}

	/**
	 * @param lblRiverWidth the lblRiverWidth to set
	 */
	public void setLblRiverWidth(JLabel lblRiverWidth) {
		this.lblRiverWidth = lblRiverWidth;
	}
	
	/**
	 * @return the panelImage
	 */
	public JPanel getPanelImage() {
		return panelImage;
	}
	
	/**
	 * @param lblRiverTitle the lblRiverTitle to set
	 */
	public void setLblRiverTitle(JLabel lblRiverTitle) {
		this.lblRiverTitle = lblRiverTitle;
	}

	/**
	 * @param lblFerryDescription the lblFerryDescription to set
	 */
	public void setLblFerryDescription(JLabel lblFerryDescription) {
		this.lblFerryDescription = lblFerryDescription;
	}

	/**
	 * @param lblCaulkDescription the lblCaulkDescription to set
	 */
	public void setLblCaulkDescription(JLabel lblCaulkDescription) {
		this.lblCaulkDescription = lblCaulkDescription;
	}

	/**
	 * @param lblFordDescription the lblFordDescription to set
	 */
	public void setLblFordDescription(JLabel lblFordDescription) {
		this.lblFordDescription = lblFordDescription;
	}

	/**
	 * @return the lblRiverTitle
	 */
	public JLabel getLblRiverTitle() {
		return lblRiverTitle;
	}

	/**
	 * @return the btnFord
	 */
	public JButton getBtnFord() {
		return btnFord;
	}

	/**
	 * @return the btnCaulk
	 */
	public JButton getBtnCaulk() {
		return btnCaulk;
	}

	/**
	 * @return the btnFerry
	 */
	public JButton getBtnFerry() {
		return btnFerry;
	}

	/**
	 * @return the lblFerryDescription
	 */
	public JLabel getLblFerryDescription() {
		return lblFerryDescription;
	}

	/**
	 * @return the lblCaulkDescription
	 */
	public JLabel getLblCaulkDescription() {
		return lblCaulkDescription;
	}

	/**
	 * @return the lblFordDescription
	 */
	public JLabel getLblFordDescription() {
		return lblFordDescription;
	}
}
